package com.ruoyi.controller;

import com.ruoyi.common.annotation.Anonymous;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.service.FeecollectionService;
import com.ruoyi.util.MailUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName FeecollectionController
 * @Description TODO
 * @Author zhangzongkai
 * @Date 2024年05月11日 12:38
 * @Version 1.0
 */
@RestController
@RequestMapping("/feecollection")
public class FeecollectionController {
    @Autowired
    private FeecollectionService feecollectionService;
    @Anonymous
    @GetMapping("/feeUrging/{id}")
    public AjaxResult feeUrging(@PathVariable Long id){
        //获取邮件
        String email = feecollectionService.findEmailByShopsId(id);
        MailUtils.sendMail(email,"您该交费了","费用催缴");
        return AjaxResult.success(200);
    }
}
